package our.pack;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

public class MediaViewVideoCameraActivity extends Activity{
	
	private VideoView screen;
	private String PATH;
	
	/**
	 * show a video
	 */
	
	public void onCreate(Bundle SaveInstanceState){
		super.onCreate(SaveInstanceState);
		//get the screen right
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.media_view_videocamera);
		
		//get the filePath
		Intent i = getIntent();
		Bundle b = i.getExtras();
		PATH = (String) b.get("PATH");
		
		//set the videoview and show the video
		screen = (VideoView) findViewById(R.id.mediaViewVideoView);
		screen.setVideoPath(PATH);
		screen.setMediaController(new MediaController(this));
		screen.requestFocus();
		screen.start();
	}

}
